package com.situ.study.day8;

public class Student extends Person{
    public String className;

    //构造方法重载
    public Student() {
        //new Person();
        //不写super()，系统默认会加上
        super();
        System.out.println("Student.Student");
    }

    public Student(String className) {
        this.className = className;
    }

    public Student(int id, String name, int age, String className) {
        //new Person(id, name, age);
        super(id, name, age);
        this.className = className;
    }

    public void study() {
        System.out.println(this.name + "正在" + this.className + "班学习");
    }

    public int study(String str) {
        System.out.println("Student.study");
        return 0;
    }

    @Override
    public void show() {
        //super代表父类对象
        //super.show();
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }
}
